package com.wkq.move.module.tv.ui.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import cn.jzvd.Jzvd
import com.wkq.base.frame.activity.MvpBindingActivity
import com.wkq.move.R
import com.wkq.move.databinding.ActivityFullBinding
import com.wkq.move.module.tv.frame.presenter.FullVideoPresenter
import com.wkq.move.module.tv.frame.view.FullVideoView
import com.wkq.move.module.tv.widget.CustomJzvdStd
import kotlinx.android.synthetic.main.activity_full.*

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/6/3
 *
 * 用途:
 */


class FullVideoActivity :
    MvpBindingActivity<FullVideoView, FullVideoPresenter, ActivityFullBinding>() {


    companion object {
        fun newInstance(context: Context, url: String?, poster: String?) {
            var intnet = Intent(context, FullVideoActivity().javaClass)
            intnet.putExtra("videoPath", url)
            intnet.putExtra("videoPoster", poster)
            context.startActivity(intnet)
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

     var videoPoster=  intent.getStringExtra("videoPoster")
      var videoPath=  intent.getStringExtra("videoPath")

//      cjs.startFullscreen(this,CustomJzvdStd.class,"","videoPoster")


    }

    override fun getLayoutId(): Int {
        return R.layout.activity_full
    }

    override fun onBackPressed() {
        if (CustomJzvdStd.backPress()) {
            return
        }
        super.onBackPressed()
    }

    override
    fun onPause() {
        super.onPause()
        CustomJzvdStd.releaseAllVideos()
    }

}